package com.chenxi.vhr.mapper;

import com.chenxi.vhr.bean.VhrEmployee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenxi.vhr.bean.vo.EmployeeVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.chenxi.vhr.bean.VhrEmployee
 */
public interface VhrEmployeeMapper extends BaseMapper<VhrEmployee> {

    /**
     * 分页查询
     * @param currentPage
     * @param size
     * @param bean
     * @return
     */
    List<EmployeeVo> selectAllInfoByPage(@Param("currentPage") Integer currentPage, @Param("size") Integer size, @Param("bean") VhrEmployee bean);

    /**
     * 分页查询总记录数
     * @param employee
     * @return
     */
    Integer count(@Param("bean") VhrEmployee employee);

    /**
     * 获取最新的工号
     * @return
     */
    Integer getMaxWorkNo();

    @Select(value = "select count(*) from vhr_employee where work_no = #{workNo}")
    Integer countByWorkNo(String workNo);

    /**
     * 根据Id查询员工
     * @param id
     * @return
     */
    EmployeeVo selectEmployeeVoById(@Param("id") Integer id);

    /**
     * 查询员工信息 和薪水信息
     * @param currentPage
     * @param size
     * @return
     */
    List<EmployeeVo> listEmpWithSalary(@Param("currentPage") Integer currentPage, @Param("size") Integer size);
}




